package com.gcd.gym.model;

import com.baomidou.mybatisplus.annotation.*;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Pattern;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.validator.constraints.Length;

import java.time.LocalDateTime;


@Getter
@Setter
@TableName("member")
public class Member {
    @TableId(value = "id",type = IdType.AUTO)
    private Integer id;
    @TableField(condition = SqlCondition.LIKE)
    @NotBlank(message = "手机号码不能为空")
    @Length(min = 11, max = 11, message = "手机号只能为11位")
    @Pattern(regexp = "^[1][3,4,5,6,7,8,9][0-9]{9}$", message = "手机号格式有误")
    private String phone;
    private String password;
    @TableField(condition = SqlCondition.LIKE)
    private String name;
    private LocalDateTime createTime;
    private Integer vip;

}
